#include "newfrienditem.h"
#include "ui_newfrienditem.h"

newfrienditem::newfrienditem(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::newfrienditem)
{
    ui->setupUi(this);

    pai=new peopleaddinfo();
    pai->move(200,100);
    pai->hide();
    connect(pai,&peopleaddinfo::addfriend,this,[=](bool add){
        qDebug()<<"newfrienditem14:addfriend";
        confirmaddinfo=true;
        if(add)
        {
            addfriend=true;
        }
        else
        {
            addfriend=false;
        }
        close();
    });
}

newfrienditem::~newfrienditem()
{
    delete ui;
}

void newfrienditem::init(QString ac, QString im, QString na,QString extrame)
{
    account=ac;
    image=im;
    name=na;
    extrames=extrame;
    ui->account->setText(account);
    ui->image->setIcon(QPixmap(im));
    ui->name->setText(name);
    pai->init(account,image,name,extrame);
}
